
"""
x = '53216A'

y = bytearray.fromhex(x)

z = str(y)
y = bytearray.fromhex("650064006f0043006e006f00690073007200650076")
print(y.decode())
z = str(y)
"""

st = "0x650064006f0043006e006f00690073007200650076000b"


def hex2string(h):
    # 需要清空空字节
    h = "00"+h[2:]
    step = 4
    b = [h[i:i+step] for i in range(0,len(h),step)]
    def mapFun(s):
        if s[0:2] == "00":
            return s[2:]
        else:
            return s

    return bytearray.fromhex("".join(map(mapFun, b))).decode()

r = hex2string(st[0:-4])
print(r)

